<?php
  session_start();
  
    if (!isset($_SESSION['playerId'])) {
        header("Location: login.php");
    }
  
?>

<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" type="text/css" href="../css/styles.css" />
  <link rel="stylesheet" type="text/css" href="../css/styles_map.css" />
  <link rel="stylesheet" type="text/css" href="../css/portal.css" />
  <link rel="stylesheet" type="text/css" href="../css/game.css" />
  <script type="text/javascript" src="../client/lib/prototype-1.5.1.1.js"></script>
  <script type="text/javascript" src="../client/lib/pathfinding.js"></script>
  <script type="text/javascript" src="../client/lib/monster.js"></script>
  <script type="text/javascript" src="../client/lib/item.js"></script>  
  <script type="text/javascript" src="../client/lib/engine.js"></script>
  <title>D5Power WebGame Engine - extends Dotk v0.5</title>
</head>

<body onLoad="initEngine();" onkeypress="keyPress(event);" onkeydown="keyDown(event);" onkeyup="keyUp(event);">

<div id="container_game">
    <!-- ingame menu -->
    <div id="ingame_menu">
      <a class="ingame_menu_item" href="#">查看</a>
      <a class="ingame_menu_item" onClick="inviteToBattle();return false;" id="ingame_menu_attack" href="#">攻击</a>
      <a class="ingame_menu_item" href="#">交易</a>
      <a class="ingame_menu_item" onClick="document.getElementById('ingame_menu').style.display='none'; return false;" href="#">取消(Esc)</a>
    </div>
    <!-- #end ingame menu -->
	<!-- #main -->
    <div id="main">
    	<div id="npcDialogBox">
        	<div id="npcDialogShow">
               
            </div>
            <div id="npcDialogBg">
            </div>
            
            <div id="npcDialogText">
                <div id="npc_name" class="npcDialogMain" style="height:20px;font-weight:bold;"></div>
                <div id="npc_say" class="npcDialogMain" style="height:140px;"></div>
                <div id="npc_option" class="npcDialogMain" style="height:20px;"></div>
            </div>
        </div>
        <!-- #battle -->
        <div id="battle_screen" style="display:none">
            <div id="title">
            	<h1>您正在战斗</h1>
            </div>
            <!--
            <div id="my_character" style="width:610px;height:420px;background:url(../pictures/fightBackground/green.jpg) center">
            	
                <div id="rival_portrait"><img src="../pictures/fightChipsets/Novice_1_right.gif" style="border:none"></div>
                <div id="portrait"><img src="../pictures/fightChipsets/Novice_0_left.gif" style="border:none"></div>
            </div>
            -->
            <div id="my_character">
                <div id="portrait"><!-- portait --></div>
                <div style="font-color: #fff; color: #fff;" id="my_info">
                    <span id="my_name"><!-- my name --></span>
                    <br>
                    <span id="my_hp"><!-- hp info --></span>            	
                </div>
            
            	<div id="options">
                    <div>
                        <p style="float: left;">
                        攻击<br>
                        <span id="action_atacar"><img style="width: 32px; height: 32px;" alt="" src="../pictures/fight/attack.jpg" onClick="attack();"></span>                        </p>
                    </div>
                    
                    <div style="position: relative; left: 10px;">
                        <p>
                        防御<br>
                        <span id="action_defender"><img style="width: 32px; height: 32px;" alt="" src="../pictures/fight/defend.jpg" onClick="defend();"></span>                        </p>
                    </div>
                </div>
            </div>
            
            <div id="rival">
                <div id="rival_portrait"></div>
                <div style="font-color: #fff; color: #fff;" id="rival_info">
                    <span id="rival_name"><!-- rival name --></span>
                    <br>
                    <span id="rival_hp"><!-- rival hp --></span>                </div>
        	</div>
        
        	<div id="battle_history" style="color:#FFF"></div>
        </div>
        <!-- #end battle -->
        
        <!-- console -->
        <div id="console">
        </div>
        <!-- #end console -->
        
        <!-- character info -->
        <div id="characterBox">
        	<div id="characterLeft">
            <img id="characterHead" src="../pictures/chipsets/none.gif"/>
            </div>
            
            <div id="characterRight">
                <div id="characterName"></div>
                <div id="characterBar" class="characterBar" style="width:148px">
                	<div id="characterHP" class="characterHP"></div>
                </div>
                <div id="characterBar_exp" class="characterBar" style="width:148px;">
                	<div id="characterEXP" class="characterEXP"></div>
                </div>
                <div class="characterInfo">
                	<span>等级：</span><span id="characterLv">1</span>
                    <span>点数：</span><span id="characterPoint">0</span>
                </div>
            </div>
            
            <div id="characterMiddle">
            	<div class="statusBox">
                	<div class="statusName">攻击</div>
                    <div id="characterATK" class="statusValue"></div>
                    <div id="characterATK_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox" style="margin-left:4px">
                	<div class="statusName">防御</div>
                    <div id="characterDEF" class="statusValue"></div>
                    <div id="characterDEF_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox">
                	<div class="statusName">力量</div>
                    <div id="characterSTR" class="statusValue"></div>
                    <div id="characterSTR_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox" style="margin-left:4px">
                	<div class="statusName">聪慧</div>
                    <div id="characterINT" class="statusValue"></div>
                    <div id="characterINT_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox">
                	<div class="statusName">敏捷</div>
                    <div id="characterAGI" class="statusValue"></div>
                    <div id="characterAGI_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox" style="margin-left:4px">
                	<div class="statusName">精准</div>
                    <div id="characterDEX" class="statusValue"></div>
                    <div id="characterDEX_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox">
                	<div class="statusName">体格</div>
                    <div id="characterVIT" class="statusValue"></div>
                    <div id="characterVIT_add" class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
                
                <div class="statusBox" style="margin-left:4px">
                	<div class="statusName"></div>
                    <div class="statusValue"></div>
                    <div class="statusButton">
                    	<img src="../pictures/ui/addStatus.gif">
                    </div>
                </div>
            </div>
            
            <div id='characterItemMenu' style="margin-top:10px">
            	<div id="CIM0" class="characterItemType" onClick="callPackage(this)">物品</div>
                <div id="CIM1" class="characterItemType" onClick="callPackage(this)">装备</div>
            </div>
            
            <div id="characterItemBox" style="display:none">
            	<!-- ItemBox
            	<div class="ItemBox" style="background:url(../pictures/item/apple.gif)" title='苹果，补充少许体力的可口水果。hp+20'>
                	<div class="ItemNumber">99</div>
                </div>
                ItemBox -->
            </div>

			<div id="equipmentBox" style='display:none'>
				
				<div id="leftEquipmentBox">
					<div title='头上' id='equHeadUp' class='ItemBox'></div>
					<div title='头下' id='equHeadDown' class='ItemBox'></div>
					<div title='左手' id='equHandLeft' class='ItemBox'></div>
					<div title='鞋子' id='equFoot' class='ItemBox'></div>
				</div>

				<div id='middleEquipmentBox'>
					<img height="90" style="display:block" id='equipmentMyAvtara'>
                	<div title='佩饰' style="margin-top:12px;margin-left:25px" id='equJewels' class='ItemBox'></div>
				</div>

				<div id='rightEquipmentBox'>
					<div title='头中' id='equHeadMiddle' class='ItemBox'></div>
					<div title='披肩' id='equArm' class='ItemBox'></div>
					<div title='右手' id='equHandRight' class='ItemBox'></div>
					<div title='戒指' id='equOther' class='ItemBox'></div>
				</div>

			</div>
        </div>
        <!-- end character info -->
        
        
        <!-- #Show Box -->
      <div id="terrain_layer"></div>
        <div id="ground_layer"></div>
        <div id="elements_layer"></div>
        <div id="characters_layer"></div>
        <div id="up_layer"></div>
        <div id="events_layer" onClick="D5MapEvent(event);"  onmousemove="showCoordinates(event);"></div>
        <div id="dialog_layer">
          <div id="dialog_container">
			  
              <div id="dialog_border_left"></div>
              <div id="dialog_border_right"></div>

              <div id="dialog_border_top"></div>
              <div id="dialog_border_bottom"></div>

              <div id="dialog_icon">
                <!-- dynamic dialog icon -->
              </div>
              <div id="dialog_text">
                <!-- dynamic dialog text -->
              </div>
              <div id="dialog_buttons">
                <!-- dynamic dialog buttons -->
              </div>
          </div>
        </div>
        <div id="loading">
            <img src="../pictures/loading.gif">
            <span id="loading_text">Loading...</span>
        </div>
  
  		<!-- #chat -->
		<div id="chat_div" status=''>
        	<div id="chat_close_button" onClick="$('chat_div').style.display = 'none';$('chat_div').setAttribute('status','hidden')">x</div>
    		<div id="chat_history" style="font-size:12px">
    		</div>
            <input onKeyDown="sendMessage(event);" id="edt_message" class="text" type="text" maxlength="180">
  		</div>
		<!-- end #chat -->
		
    </div>
	<!-- end #main -->   
</div>
<div id="debug" style="position: absolute; width: 360px; heigth: 10px; left: 150px; top: 20px; color: #ffffff; font-size: 12px; font-family: 'courier new',Arial;">
</div>  

 <div id="preload" style="visibility: hidden;">
<img src="../pictures/chipsets/Novice_1_east1.gif">
<img src="../pictures/chipsets/Novice_1_east2.gif">
<img src="../pictures/chipsets/Novice_1_east3.gif">
<img src="../pictures/chipsets/Novice_1_east4.gif">
<img src="../pictures/chipsets/Novice_1_west1.gif">
<img src="../pictures/chipsets/Novice_1_west2.gif">
<img src="../pictures/chipsets/Novice_1_west3.gif">
<img src="../pictures/chipsets/Novice_1_west4.gif">
<img src="../pictures/chipsets/Novice_1_south1.gif">
<img src="../pictures/chipsets/Novice_1_south2.gif">
<img src="../pictures/chipsets/Novice_1_south3.gif">
<img src="../pictures/chipsets/Novice_1_south4.gif">
<img src="../pictures/chipsets/Novice_1_north1.gif">
<img src="../pictures/chipsets/Novice_1_north2.gif">
<img src="../pictures/chipsets/Novice_1_north3.gif">
<img src="../pictures/chipsets/Novice_1_north4.gif">
<img src="../pictures/chipsets/Novice_0_east1.gif">
<img src="../pictures/chipsets/Novice_0_east2.gif">
<img src="../pictures/chipsets/Novice_0_east3.gif">
<img src="../pictures/chipsets/Novice_0_east4.gif">
<img src="../pictures/chipsets/Novice_0_west1.gif">
<img src="../pictures/chipsets/Novice_0_west2.gif">
<img src="../pictures/chipsets/Novice_0_west3.gif">
<img src="../pictures/chipsets/Novice_0_west4.gif">
<img src="../pictures/chipsets/Novice_0_south1.gif">
<img src="../pictures/chipsets/Novice_0_south2.gif">
<img src="../pictures/chipsets/Novice_0_south3.gif">
<img src="../pictures/chipsets/Novice_0_south4.gif">
<img src="../pictures/chipsets/Novice_0_north1.gif">
<img src="../pictures/chipsets/Novice_0_north2.gif">
<img src="../pictures/chipsets/Novice_0_north3.gif">
<img src="../pictures/chipsets/Novice_0_north4.gif">
<img src="../pictures/face/xiao.gif">
<img src="../pictures/face/ku.gif">
<img src="../pictures/face/jianxiao.gif">
<img src="../pictures/face/kao.gif">
<img src="../pictures/face/han.gif">
<img src="../pictures/face/hao.gif">
<img src="../pictures/face/qin.gif">
<img src="../pictures/face/ye.gif">
<img src="../pictures/face/en.gif">
<img src="../pictures/face/haoyangde.gif">
</div>
</body>
</html>
